package com.example.mygame;

public class ChessPiece {
    private int camp = CAMP_WHITE;//阵营
    private int x = 0,y = 0;//坐标
    private int power_current = 0;//战力（当前）
    private int power_original = 0;//战力（原始）
    private int countdown = -1;//恢复倒计时

    public static final int CAMP_BLOCK = -1;//路障
    public static final int CAMP_WHITE = 0;//中立单位
    public static final int CAMP_RED = 1;//红方
    public static final int CAMP_BLUE = 2;//蓝方

    //-------------------------------------------------------------------------
    //构造
    public ChessPiece() {
        this.x = 0;
        this.y = 0;
        this.camp = CAMP_WHITE;
        this.power_original = 0;
        this.power_current = 0;
        this.countdown=-1;
    }

    public ChessPiece(int x, int y) {
        this.x = x;
        this.y = y;
        this.camp = CAMP_WHITE;
        this.power_original = 0;
        this.power_current = 0;
        this.countdown=-1;
    }

    public ChessPiece(int x, int y, int power_original) {
        this.x = x;
        this.y = y;
        this.camp = CAMP_WHITE;
        this.power_original = power_original;
        this.power_current = power_original;
        this.countdown=-1;
    }
    public ChessPiece(int x, int y, int camp, int power_original) {
        this.x = x;
        this.y = y;
        this.camp = camp;
        this.power_original = power_original;
        this.power_current = power_original;
        this.countdown=-1;
    }

    public ChessPiece(ChessPiece ori)
    {
        this.x = ori.getX();
        this.y = ori.getY();
        this.camp = ori.getCamp();
        this.power_original = ori.getPower_original();
        this.power_current = ori.getPower_current();
        this.countdown=ori.getCountdown();
    }

    //-------------------------------------------------------------------------
    //获取
    public int getCamp() {
        return camp;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int getPower_current() {
        return power_current;
    }

    public int getPower_original() {
        return power_original;
    }

    public int getCountdown() {
        return countdown;
    }

    //-------------------------------------------------------------------------
    //设置

    public void setCamp(int camp) {
        this.camp = camp;
    }

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void setPower_current(int power_current) {
        this.power_current = power_current;
    }

    public void setPower_original(int power_original) {
        this.power_original = power_original;
    }

    public void setCountdown(int countdown) {
        this.countdown = countdown;
    }

    public void setToValueOf(ChessPiece ori)
    {
        this.setX(ori.getX());
        this.setY(ori.getY());
        this.setCamp(ori.getCamp());
        this.setPower_original(ori.getPower_original());
        this.setPower_current(ori.getPower_current());
        this.setCountdown(ori.getCountdown());
    }
    public void setToPositionOf(ChessPiece ori)
    {
        this.setX(ori.getX());
        this.setY(ori.getY());
    }
}
